<%--
    Document   : loginlogado
    Created on : 10/10/2011, 19:21:30
    Author     : Carlos, Edward, Diego, Honorioi
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="model.Usuario, javax.servlet.http.HttpSession, dao.UsuarioDAO, dao.imp.UsuarioDAOImpl"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="style.css" type="text/css" media="screen">
        <title>DADOS DO CLIENTE</title>
    </head>

    <jsp:include page="topologado.jsp"/>
    <body >

        <%
            HttpSession sessao = request.getSession(true);
            try {
                Usuario usuario = (Usuario) sessao.getAttribute("usuario");
                if(usuario.getLogin().equals("admin") && usuario.getSenha().equals("admin")){
                    response.sendRedirect("indexAdmin.jsp");
                }else if (usuario.getCpf() == null) {
                    response.sendRedirect("login.jsp");
                } else {
        %>

        <div id="content">
            <br><br><br><br>

            <table style="text-align: left; width: 0%;" border="1" bordercolor=cccccc cellpadding="2" cellspacing="2" align="center">
                <tbody>
                    <tr>
                        <td style="vertical-align: top; text-align: right;"><b>Id: </b></td>
                        <td style="vertical-align: top; text-align: left;"><%= usuario.getId()%></td>
                    </tr>
                    <tr>
                        <td style="vertical-align: top; text-align: right;"><b>Nome: </b></td>
                        <td style="vertical-align: top; text-align: left;"><%= usuario.getNome()%></td>
                    </tr>
                    <tr>
                        <td style="vertical-align: top; text-align: right;"><b>CPF: </b></td>
                        <td style="vertical-align: top; text-align: left;"><%= usuario.getCpf()%></td>
                    </tr>
                    <tr>
                        <td style="vertical-align: top; text-align: right;"><b>Telefone: </b></td>
                        <td style="vertical-align: top; text-align: left;"><%= usuario.getTelefone()%></td>
                    </tr>
                    <tr>
                        <td style="vertical-align: top; text-align: right;"><b>Email: </b></td>
                        <td style="vertical-align: top; text-align: left;"><%= usuario.getEmail()%></td>
                    </tr>
                    <tr>
                        <td style="vertical-align: top; text-align: right;"><b>Login: </b></td>
                        <td style="vertical-align: top; text-align: left;"><%= usuario.getLogin()%></td>
                    </tr>
                    <tr>
                        <td style="vertical-align: top; text-align: right;"><b>Senha: </b></td>
                        <td style="vertical-align: top; text-align: left;"><%= usuario.getSenha()%></td>
                    </tr>

                </tbody>
            </table>

            <center><a href="atualizarUsuario.jsp">
                    Atualizar Cadastro
                </a></center>
            <center><a href="/AirLine/controlador?cmd=excluirUser&cpf=<%= usuario.getCpf()%>">
                    Exluir sua conta
                </a></center>
        </div>



        <%
                }
            } catch (Exception e) {
                e.printStackTrace();
                response.sendRedirect("login.jsp");
            }

        %>
    </body>
    <jsp:include page="rodape.jsp"/>

</html>
